import { createRouter, createWebHashHistory } from 'vue-router'
import Layout from '@/views/Layout/Layout.vue'
import Home from '@/views/Home/Home.vue'
const routes = [
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/Login/Login.vue')
  },
  {
    path: '/',
    name: 'layout',
    component: Layout,
    children: [
      {
        path: '',
        name: 'home',
        component: Home
      },
      {
        path: '/categroy/:id',
        name: 'categroy',
        component: () => import('@/views/Categroy/Categroy.vue')
      },
      {
        path: '/goods/:id',
        name: 'goods',
        component: () => import('@/views/Goods/Goods.vue')
      },
      {
        path: '/cart', //
        name: 'cart',
        component: () => import('@/views/Cart/Cart.vue')
      },
      {
        path: '/settlement',
        name: 'settlement',
        component: () => import('@/views/Settlement/Settlement.vue')
      },
      {
        path: '/pay',
        name: 'pay',
        component: () => import('@/views/Pay/Pay.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
